README for replication files

----------------------------

ARTICLE: “Polarization but Not Populism Strengthens the Association Between Presidential Election Results and Emotions”
AUTHORS: Dahjin Kim, Taishi Muraoka, Christopher Lucas, Jacob Montgomery and Margit Tavits

----------------------------

SOFTWARE AND PACKAGES:

	R: Version 4.2.2
	Platform: x86_64-w64-mingw32/x64 (64-bit)    
    Operating System: mingw32
    R package: `brms` (version: 2.19.0) 
    	*** Make sure you have the correct version!
    	*** Run the following code to install the correct version: devtools::install_version("brms", version='2.19.0')
	
----------------------------

FILE LIST:
	Main.pdf: main manuscript

	Appendix.pdf: online appendix

	Codebook.pdf: codebook for all variables included in each data file
	
	Datasets:
		PresidentialElectionsPosts.RData: Post-level data in the main analysis
		SurveyResponses.RData: Survey data used in Main Figure 1.R and Appendix E SurveyOLS.R
		PresidentialElections.RData: Presidential candidate-level data used in Appendix B VoteShare.R
		EmotionDifferentElectionsComparison.RData: Post-level data of top two parties in presidential and legislative elections used in Appendix S1 OtherElections.R
		PresidentialCountries.RData: Country-level data used in Appendix S2 OtherSystems.R
		
	R codes:
		Main Figure 1.R: R code to replicate Figure 1 of the main text
		Main Descriptive.R: R code to replicate Figures 2 and 3 of the main text 
		Main Regressions.R: R code to replicate Figures 4 to 6 of the main text 
		
		Appendix A Surprise.R: R code to replicate Figures A.1 to A.4 in Appendix A
		Appendix B VoteShare.R: R code to replicate Figure B.1 in Appendix B
		Appendix C ElectionParties.R: R code to replicate Tables C.1 and C.2 in Appendix C
		Appendix D EmotionDescriptive.R: R code to replicate Table D.1 in Appendix D
		Appendix E SurveyOLS.R: R code to replicate Table E.1 in Appendix E
		Appendix F ByParty.R: R code to replicate Figure F.1 in Appendix F
		Appendix G NPosts.R: R code to replicate Figure G.1 in Appendix G
		Appendix H Polarization.R: R code to replicate Figure H.1 in Appendix H
		Appendix I VParty.R: R code to replicate Figures I.1 and I.2 in Appendix I
		Appendix J Residuals.R: R code to replicate Figure J.1 in Appendix J
		Appendix K OtherTimeWindows.R: R code to replicate Figure K.1 in Appendix K 
		Appendix L Descriptive.R: R code to replicate Table L.1 and L.2 of Appendix L
		Appendix M InteractionTable.R: R code to replicate Tables M.1 and M.2 of Appendix M
		Appendix N1 AlternativeCutoffs.R: R code to replicate Figure N.1 of Appendix N
		Appendix N2 PopulismAverage.R: R code to replicate Figure N.2 of Appendix N
		Appendix N3 PopulismDifference.R: R code to replicate Figure N.3 of Appendix N
		Appendix N4 PopulistPartyDummy.R: R code to replicate Figure N.4 of Appendix N
		Appendix N5 PopulistPartyContinuous.R: R code to replicate Figure N.5 of Appendix N
		Appendix N6 PopulismQualityDemocracy.R: R code to replicate Table N.1 and Figure N.6 of Appendix N
		Appendix O TwoPolarizations.R: R code to replicate Table O.1 and Figure O.2 of Appendix O
		Appendix P Outliers.R: R code to replicate Tables P.1 and P.2 and Figure P.1 of Appendix P
		Appendix Q ThreeWaysInteraction.R: R code to replicate Table Q.1 and Figure Q.2 of Appendix Q
		Appendix R USSentiment.R: R code to replicate Figure R.1 of Appendix R
		Appendix S1 OtherElections.R: R code to replicate Table S.1 of Appendix S
		Appendix S2 OtherSystems.R: R code to replicate Table S.2 of Appendix S	
	
	Stan model outputs:
		Stan_15Days.RData: Stan fits used in the main analysis
		Stan_Surprise.RData: Stan fits used in Main Descriptive.R
		Stan_10Days.RData: Stan fits used in Appendix K OtherTimeWindows.R
		Stan_20Days.RData: Stan fits used in Appendix K OtherTimeWindows.R
		Stan_25Days.RData: Stan fits used in Appendix K OtherTimeWindows.R
		Stan_30Days.RData: Stan fits used in Appendix K OtherTimeWindows.R
		Stan_5Days.RData: Stan fits used in Appendix K OtherTimeWindows.R
		Stan_VParty.RData: Stan fits used in Appendix I VParty.R
		Stan_PopulismAlternativeCutoffs.RData: Stan fits used in Appendix N1 AlternativeCutoffs.R
		Stan_PopulismAverage.RData: Stan fits used in Appendix N2 PopulismAverage.R
		Stan_PopulismDifference.RData: Stan fits used in Appendix N3 PopulismDifference.R
		Stan_PopulistParty.RData: Stan fits used in Appendix N4 PopulistPartyDummy.R
		Stan_PopulistPartyContinuous.RData: Stan fits used in Appendix N5 PopulistPartyContinuous.R
		Stan_PopulismQuaityDemocracy.RData: Stan fits used in Appendix N6 PopulismQualityDemocracy.R
		Stan_TwoPolarization.RData: Stan fits used in Appendix O TwoPolarizations.R
		Stan_Outliers.RData: Stan fits used in Appendix P Outliers.R
		Stan_ThreeWaysInteraction.RData: Stan fits used in Appendix Q ThreeWaysInteraction.R
	
	Logs: R console output for each R code file ({R code file name} log.txt)